<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', ['as' => 'home' , 'uses' => function () {
    return view('welcome');
}]);
Route::group([], function ($route) {
    $route->get('login', 'Auth\AuthController@getLogin');
    $route->post('login', 'Auth\AuthController@postLogin');
    $route->get('register', 'Auth\AuthController@getRegister');
    $route->post('register', 'Auth\AuthController@postRegister');
    $route->get('logout', 'Auth\AuthController@logout');
});

Route::group(['middleware' => 'auth'], function ($route) {
    $route->get('me', ['as' => 'user-me', 'uses' => 'User\UserController@me']);
    $route->resource('album', 'Photo\AlbumController');
    $route->resource('photo', 'Photo\PhotoController');
});